package com.ruoyi.pay.controller;

import com.repair.api.pay.request.param.PayQueryParam;
import com.repair.api.pay.response.vo.PaymentInfoVO;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.pay.service.PayRefundService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author chunyu
 * @since 2024/10/21,21:09
 */
@Api(tags = "退款单模块")
@RestController
@RequestMapping("/admin/pay/refund")
public class PayRefundController {

    @Autowired
    private PayRefundService payRefundService;

    @ApiOperation("查询退款单列表（分页）")
    @GetMapping("getRefundList")
    public R<TableDataInfo> getRefundList(PayQueryParam param) {
        TableDataInfo tableDataInfo = payRefundService.getRefundList(param);
        return R.ok(tableDataInfo);
    }

    @ApiOperation("查询退款单详情")
    @GetMapping("getRefundDetail")
    public R<PaymentInfoVO> getRefundDetail(String orderPayNum) {
        PaymentInfoVO paymentInfoVO = payRefundService.getRefundDetail(orderPayNum);
        return R.ok(paymentInfoVO);
    }



}
